import { contextBridge, ipcRenderer } from "electron";
import pkg from "../../package.json";
import { IpcEvents } from "../common/ipcEvents";
import { ThemeColor } from "../common/theme";



const nativeApi = {
  version: pkg.version,
  setThemeColor(color: ThemeColor) {
    ipcRenderer.send(IpcEvents.SET_THEME_COLOR, color);
  },
};

declare global {
  interface Window {
    navtiveApi: typeof nativeApi;
  }
}

contextBridge.exposeInMainWorld("nativeApi", nativeApi);
